<template>
	<div>
  <el-table
    :data="tableData"
    border
    style="width: 100%">
    <el-table-column
      fixed
      prop="dno"
      label="采购明细号"
      width="150">
    </el-table-column>
    <el-table-column
      prop="pno"
      label="采购清单号"
      width="150">
    </el-table-column>
    <el-table-column
      prop="gno"
      label="商品编号"
      width="100">
    </el-table-column>
    <el-table-column
      prop="dcount"
      label="采购数量"
      width="120">
    </el-table-column>
    <el-table-column
      prop="donemoney"
      label="商品单价"
      width="150">
    </el-table-column>
	<el-table-column
	  prop="dtotalmoney"
	  label="商品总价"
	  width="150">
	</el-table-column>
	<el-table-column
	  prop="dremark"
	  label="备注"
	  width="150">
	</el-table-column>
  </el-table>
  <el-pagination
    background
    layout="prev, pager, next"
	page-size="5"
    :total="total"
	@current-change="page">
  </el-pagination>
  </div>
</template>

<script>
  export default {
	  name: "DetailSearch2",
    methods: {
      edit(row) {
        this.$router.push({
			path:'/detailupdate',
			query:{
				id:row.dno
			}
		})
      },
	  page(currentPage){
		  const _this = this
		  axios.get('http://localhost:8181/detail/findAll/'+currentPage+'/5').then(function(resp){
		  	_this.tableData = resp.data.content
		  	_this.total = resp.data.totalElements
		  })
	  }
    },
	created(){
		const _this = this
		axios.get('http://localhost:8181/detail/findAll/1/5').then(function(resp){
			console.log(resp)
			_this.tableData = resp.data.content
			_this.total = resp.data.totalElements
		})
		
	},
    data() {
      return {
		  total: null,
		  tableData: null
      }
    }
  }
</script>
